package org.generics;

import java.util.Collection;

/**
 * fromArrayToCollection holder.
 */
public class ArrayToCollection {

    private ArrayToCollection() {
    }

    /**
     * Copies objects of specified type from array to collection.
     *
     * @param a array with objects
     * @param c collection, where objects have to be copied
     * @param <T> any type
     */
    public static <T> void fromArrayToCollection(T[] a, Collection<T> c) {
        for (T obj : a) {
            c.add(obj);
        }
    }

}
